<!-- 

 -->
<script>
function delay(ms) {
    return new Promise(function (resolve) {
      setTimeout(() => resolve(), ms)
    })
  }

async function fn(){
    console.log(2);
    // await delay(1000)
    await 1
    // Promise.resolve(1).then(()=>{
    //     console.log(3);
    //     // await 2 不能这样写，报错
    // })
    // await delay(2000)
    console.log(3);
}
console.log(1);
fn()
console.log(4);




</script>